package com.vhall.component.entity.room.enums;

import com.vhall.component.entity.dictionary.enums.BaseEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 合格投资者要求-
 *
 * @author xing.wang
 * @date 2023/8/7
 */
@Getter
@AllArgsConstructor
public enum InvestorReqEnum implements BaseEnum {
    NO_REQUIREMENT("0", "无要求"),
    PRIVATE_PLACEMENT("1", "仅私募合格投资者可见"),
    ASSET_MANAGEMENT("2", "仅资管合格投资者可见");
    private final String value;
    private final String name;
    @Override
    public String getValue() {
        return value;
    }
    @Override
    public String getName() {
        return name;
    }
    /**
     * 通过 value 获取 name
     * @param value
     * @return
     */
    public static String getNameByValue(String value) {
        for (InvestorReqEnum e : InvestorReqEnum.values()) {
            if (e.getValue().equals(value)) {
                return e.getName();
            }
        }
        return null;
    }
}
